#include "Position.h"
#include "Constant.h"

#include <iostream>
using namespace std;

Position::Position (int _x, int _y) : x (_x), y (_y) 
{}

int Position::getX () 
{
	return x;
}

int Position::getY () 
{
	return y;
}

void Position::setX (int _x) 
{
	x = _x;
}

void Position::setY (int _y) 
{
	y = _y;
}



bool Position::operator== (Position& pos) const
{
	if(pos.getX() == x && pos.getY() == y) return true;
	return false;
}

bool Position::operator!= (Position& pos) const
{
	return !this->operator ==(pos);
}



void Position::display ()
{
	cout << "Position ( " << x << " ; " << y << ")" << endl; 
}







void Position::move(Direction direction)
{
	switch ( direction ) 
	{
		case directionRIGHT : x++; break;
		case directionLEFT : x--; break;
		case directionUP : y--; break;
		case directionDOWN : y++; break;
	}
}


























